package com.pojo;

import javax.print.DocFlavor;
import java.util.Date;

/**
 * @description: 机票信息
 */
public class Ticket {
    /**
     * @description: 机票ID
     */
    private int ticketId;
    /**
     * @description: 航班ID
     */
    private int flightId;
    /**
     * @description: 用户ID
     */
    private int userId;
    /**
     * @description: 舱位
     */
    private String cabin;
    /**
     * @description: 价格
     */
    private double price;
    /**
     * @description: 优惠
     */
    private String offer;

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public Flight getFlight() {
        return flight;
    }

    public void setFlight(Flight flight) {
        this.flight = flight;
    }

    /**
     * 创建时间
     */
    private String createTime;

    private User user;//旅客信息 数据表中是userId 根据userId查询旅客信息最后关联到User中
    private Flight flight;//航班信息 数据表中是flightId 根据flightId查询航班信息最后关联到Flight中

    public int getTicketId() {
        return ticketId;
    }

    public void setTicketId(int ticketId) {
        this.ticketId = ticketId;
    }

    public int getFlightId() {
        return flightId;
    }

    public void setFlightId(int flightId) {
        this.flightId = flightId;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    public String getCabin() {
        return cabin;
    }

    public void setCabin(String cabin) {
        this.cabin = cabin;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getOffer() {
        return offer;
    }

    public void setOffer(String offer) {
        this.offer = offer;
    }

    public String getCreateTime() {
        return createTime;
    }

    public void setCreateTime(String createTime) {
        this.createTime = createTime;
    }

    @Override
    public String toString() {
        return "Ticket{" +
                "ticketId=" + ticketId +
                ", flightId=" + flightId +
                ", userId=" + userId +
                ", cabin='" + cabin + '\'' +
                ", price=" + price +
                ", offer='" + offer + '\'' +
                ", createTime='" + createTime + '\'' +
                ", user=" + user +
                ", flight=" + flight +
                '}';
    }
}
